<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
	<f:view>
		<p:commandButton value="Novo Cadastro" action="#{pacientePessoaManager.prepareSave}" ajax="false"/>
		
		<p:dataTable value="#{pacientePessoaManager.pacientes}" var="m" rows="5" paginator="true"
		emptyMessage="Não existem resultados."
		>
			<p:column headerText="Nome">
				<h:outputText value="#{m.nome}" />
			</p:column>
			<p:column headerText="CPF">
				<h:outputText value="#{m.cpf}" />
			</p:column>
			<p:column headerText="Ação">
				<p:commandButton value="Atualizar" action="#{pacientePessoaManager.prepareUpdate}" process="@this" update=":form">
					<f:setPropertyActionListener target="#{pacientePessoaManager.paciente}" value="#{m}" />
				</p:commandButton>
				<p:commandButton value="Excluir" action="#{pacientePessoaManager.delete}" process="@this" update=":list_paciente">
					<f:setPropertyActionListener target="#{pacientePessoaManager.paciente}" value="#{m}" />
				</p:commandButton>
			</p:column>
			
		</p:dataTable>
	</f:view>
</html>